<template>
  <div class="blogList-box flex-column">
    <div class="header-box flex-row">
      <div>名称</div>
      <div>创建时间</div>
    </div>
    <div class="content-box flex-column">
      <div class="content-item flex-row" v-for="item in blogs" :key="item.id">
         <div class="title cp" @click="goBlog(item.id)">{{item.title}}</div>
         <div class="date">{{item.createTime}}</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'BlogList',
  props: {
    blogs: {
      required: true,
      type: Array
    }
  },
  methods: {
    goBlog(id) {
      this.$emit('goBlog', id)
    }
  }
}
</script>

<style scoped lang="less">
.blogList-box{
  .header-box{
    color: #849aa4;
    padding: 0 50px;
    padding-right: 70px;
    justify-content: space-between;
    height: 50px;
    line-height: 50px;
    background:#f9fafc;
  }
  .content-box{
    .content-item{
      justify-content: space-between;
      height: 60px;
      line-height: 60px;
      border-bottom: 1px solid #eee;
      .title{
        margin-left: 50px;
        &:hover{
          color: #3593f2;
        }
      }
      .date{
        margin-right: 50px;
      }
    }
  }
}
</style>